package com.example.concurrent.chapter01;

import java.util.stream.IntStream;

/**
 * @author Create By Liuqz
 * @date 2018/11/19 11:13
 */
public class ThreadConstruction {

    private static final String PREFIX = "ALEX_";

    private static Thread createThread(final int intName) {
        return new Thread(() -> System.out.println(Thread.currentThread().getName()), PREFIX + intName);
    }

    public static void main(String[] args) {
        IntStream.rangeClosed(0,5).mapToObj(ThreadConstruction::createThread).forEach(Thread::start);
    }
}
